<?php

/**
 * Supplier form.
 *
 * @package    seth
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class SupplierForm extends BaseSupplierForm
{

  public function configure()
  {
      //Field Ref1
      $this->widgetSchema['ref1'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Contact'), 'add_empty' => false, 'order_by'=>array('surname','asc')));
      $this->validatorSchema['ref1'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Contact'),'required' => true)); 
       
      //Field Ref2
      $this->widgetSchema['ref2'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Contact_2'), 'add_empty' => true, 'order_by'=>array('surname','asc')));
      $this->validatorSchema['ref2'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Contact_2'),'required' => false));
      
      //Field Ref3
      $this->widgetSchema['ref3'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Contact_3'), 'add_empty' => true, 'order_by'=>array('surname','asc')));
      $this->validatorSchema['ref3'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Contact_3'),'required' => false));
      
      //helper
      $this->widgetSchema->setHelp('ref1','Can\'t find the right person? Create');
  }
}
